<?php

	require_once ("inc/Database.inc");
	
	$link = ConnectToDatabase2();
	
	$sql = "SELECT `date` as date, news, title FROM news ORDER BY date DESC";
	$result = RunSql($sql,$link);
	
?>
		<div class="News">
<?php 
		while ($row = mysql_fetch_assoc($result)) 
		{
			$dateParts = explode("-", $row['date']);
			$date = date('F j, Y', mktime(0,0,0,$dateParts[1], $dateParts[2], $dateParts[0]));
			$title= html_entity_decode(stripslashes($row['title']));
			$news = html_entity_decode(stripslashes($row['news']));
?>
			<div class="newsContainer">
				<div class="titleContainer"><span><?php echo $title?></span> <span class="date"><?php echo $date?></span></div>
				<div class="news"><?php echo $news?></div>
			</div>
<?php 
		}
?>
		</div>